package com.corpgovernment.job.batchimport.mapper;

import com.corpgovernment.job.batchimport.entity.db.BatchImportErrorLineDo;
import com.corpgovernment.job.enums.DeletedEnum;
import com.corpgovernment.organization.common.mybatis.TkMapper;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author ldma
 * @date 2024/1/25
 */
public interface BatchImportErrorLineMapper extends TkMapper<BatchImportErrorLineDo> {

    default void batchInsert(List<BatchImportErrorLineDo> batchImportErrorLineDoList) {
        insertList(batchImportErrorLineDoList);
    }

    default List<BatchImportErrorLineDo> listByRecordId(Long recordId) {
        Example example = new Example(BatchImportErrorLineDo.class);
        example.createCriteria().andEqualTo("recordId", recordId).andEqualTo("deleted", DeletedEnum.FALSE.getCode());
        return selectByExample(example);
    }

}
